<template>
  <div>
      <h1>这是首页页面展示的数字{{count}}</h1>
      <button @click="add">增加1</button>&nbsp;
       <button @click="addPlus">链接字符</button>
      <TypeNav></TypeNav>
      <ListContainer></ListContainer>
     <TodayRecommend></TodayRecommend>
     <Rank></Rank>
     <Like></Like>
     <Floor></Floor>
     <Brand></Brand>
  </div>
</template>

<script>
import TypeNav from './TypeNav'
import ListContainer from './ListContainer'
import TodayRecommend from './TodayRecommend'
import Rank from './Rank'
import Like from './Like'
import Floor from './Floor'
import Brand from './Brand'
import {reqCategoryList} from '@/api/index'
import {mapState} from 'vuex'
export default {
  name :'Home',
  components:{
      TypeNav,ListContainer,
      TodayRecommend,
      Rank,Like,
      Floor,
      Brand
  },
  methods: {
      add(){
           this.$store.dispatch('add');
      },
      addPlus(){
            this.$store.dispatch('addPlus',2)
      }
  },
  computed:{
      ...mapState(['count'])
  },
  mounted() {
      reqCategoryList();
      console.log(this.$store)
  },
}
</script>

<style>

</style>